Application.StatusBarText = "Unfix Objects"
dim status : status = false
dim doc
set doc = application.ActiveDocument
'components
'msgbox "components"
Set objs = doc.GetObjects(1,,true)
if objs.count>0 then
	for each obj in objs
		'msgbox obj.name
		obj.Glued = status
		obj.selected = true
	next
	Application.ExecuteCommand("Properties")
	ComponentPropertiesDlg.Glued = status
	ComponentPropertiesDlg.Ok.Click()
	ClearanceViolationsDlg.Ignore.Click()
end if
'vias
'msgbox "vias"
Set objs = doc.GetObjects(4,,true) 
if objs.count>0 then
	for each obj in objs
		obj.Glued = status
		obj.selected = false
	next
	'Application.ExecuteCommand("Properties")
	'ViaPropertiesDlg.Glued = status
	'ViaPropertiesDlg.Ok.Click()
end if

'traces
'msgbox "traces"
'Set objs = doc.GetObjects(6,,true) 
'msgbox objs.count
'if objs.count>0 then
'	for each obj in objs
'		obj.net.selected =true
'	next
	'Application.ExecuteCommand("Properties")
	'TracePropertiesDlg.Net.Click()
	'NetPropertiesDlg.ProtectRoutes = status
	'NetPropertiesDlg.Ok.Click()
	'TracePropertiesDlg.Ok.Click()
'end if

'nets
'msgbox "nets"
Set objs = doc.GetObjects(2,,true) 
'msgbox objs.count
if objs.count>0 then
	Application.ExecuteCommand("Properties")
	NetPropertiesDlg.ProtectRoutes = status
	NetPropertiesDlg.Ok.Click()
	for each obj in objs
		obj.selected =false
	next
end if
'
'msgbox "done"
